# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.
# Originally from the AUR.

pkgname=perl-io-socket
pkgver=1.45
pkgrel=5
pkgdesc='Object interface to socket communications.'
arch=('x86_64' 'aarch64')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl>=0')
url='http://search.cpan.org/~gbarr/IO-1.25/lib/IO/Socket.pm'
source=("http://search.cpan.org/CPAN/authors/id/T/TO/TODDR/IO-$pkgver.tar.gz")
sha512sums=('886b11c1674dc9d4b7afe5af4ace12d1a6cc1372aaedba464f5494c80611d127213545e3cb696892ca9b47a5d4249d6ea5fc7ad809c2e37c9c1139464baaa739')

build() {
  cd "IO-$pkgver"

  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB="" PERL_AUTOINSTALL=--skipdeps \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
    PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
    MODULEBUILDRC=/dev/null

    /usr/bin/perl Makefile.PL

    make
  )
}

package() {
  cd "IO-$pkgver"

  make install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

